package ch.five;

public class TenToSixteen {
    public static void main( String[] args ) {
        System.out.println( tenToEight(15) );

    }

    public static int tenToSixteen(int x) {
        return 0;
    }

    public static int tenToEight(int n) {
        int count =0;
        int eight =0;

        if (n<0) {
            return -1;
        }

        if (n<8) {
            return n;
        }

        while (n>0) {
            eight = eight+(n%8*(10^count));
            n=n/8;
            count++;
        }

        return eight;
    }
}
